package com.heima.admin.v1.controller;

import com.heima.common.dtos.ResponseResult;
import com.heima.feign.WemediaFeign;
import com.heima.model.admin.dtos.NewsAuthDelDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "媒体相关接口" )
@RestController
@Slf4j
@RequestMapping("/api/v1/news_auth")
public class NewsAuthController {


    @Autowired
    private WemediaFeign wemediaFeign;

    /**
     * 文章审核不通过
     */
    @ApiOperation("媒体审核不通过")
    @PostMapping("/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDelDto dto){

        wemediaFeign.authFail(dto);

        return ResponseResult.ok();
    }

    /**
     * 媒体审核通过
     * @param dto
     * @return
     */
    @ApiOperation("媒体审核通过")
    @PostMapping("/auth_pass")
    public ResponseResult authPass(@RequestBody NewsAuthDelDto dto){

        wemediaFeign.authPass(dto);
        return ResponseResult.ok();
    }

}
